package org.mine.design.flyweight.controller;

import org.mine.design.flyweight.enums.DemoEnum;
import org.mine.design.flyweight.service.DemoService;
import org.mine.design.flyweight.service.flyweight.DemoFlyweightFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class FlyweightController {





    @RequestMapping("/flyweight/test")
    public void test(){
        DemoService demoServiceOne = DemoFlyweightFactory.getDemoServiceByDemoEnum(DemoEnum.ONE);
        demoServiceOne.test();

        DemoService demoServiceTwo = DemoFlyweightFactory.getDemoServiceByDemoEnum(DemoEnum.TWO);
        demoServiceTwo.test();
    }
}
